<template>
    <a-modal
            title="查看"
            :visible="visible"
            width="1200px"
            @ok="handleOk"
            :confirmLoading="confirmLoading"
            @cancel="handleCancel"
    >
        <a-form-model ref="form" :model="form">
            <a-descriptions bordered  :column="2">
                <a-descriptions-item label="载体名称">
                    {{form.carrierName | xls}}
                </a-descriptions-item>
                <a-descriptions-item label="载体级别">
                    {{form.carrierLevel | carrierLevel}}
                </a-descriptions-item>
                <a-descriptions-item label="载体类别">
                    {{getType(form.carrierType)}}
                </a-descriptions-item>
                <a-descriptions-item label="运营机构">
                    {{form.comName | xls}}
                </a-descriptions-item>
                <a-descriptions-item label="机构性质">
                    {{form.comNature | comNature}}
                </a-descriptions-item>
                <a-descriptions-item label="场地面积(平方米)">
                    {{form.buildingArea | xln}}
                </a-descriptions-item>
                <a-descriptions-item label="其中企业办公面积(平方米)">
                    {{form.workingArea | xln}}
                </a-descriptions-item>
                <a-descriptions-item label="是否设立孵化基金" v-if="form.carrierType == 1 || form.carrierType == 3">
                    {{form.incubatedFundFlag | bool}}
                </a-descriptions-item>
                <a-descriptions-item label="孵化基金金额(万元)" v-if="form.carrierType == 1 || form.carrierType == 3">
                    {{form.incubatedFundAmt | xln}}
                </a-descriptions-item>
                <a-descriptions-item label="载体管理制度建设" span="2" v-if="form.carrierType == 1  || form.carrierType == 3">
                    {{form.regulationType}}
                </a-descriptions-item>
                <a-descriptions-item label="载体管理制度建设"  v-if="form.carrierType == 2" span="2">
                    {{form.regulationType | regulationType}}
                </a-descriptions-item>

                <a-descriptions-item label="设施和条件情况"  v-if="form.carrierType == 2" span="2">
                    {{form.facilityType | facilityType}}
                </a-descriptions-item>

                <a-descriptions-item label="载体成立时间" span="2">
                    <a-form-model-item>
                        {{form.carrierRegDate | date}}
                    </a-form-model-item>
                </a-descriptions-item>
                <a-descriptions-item label="载体logo" span="2">
                    <xlImages v-model="form.carrierLogo" :max="0"></xlImages>
                </a-descriptions-item>
                <a-descriptions-item label="营业执照上传" span="2">
                    <xlImages v-model="form.baseLicensePath" :max="0"></xlImages>
                </a-descriptions-item>
                <a-descriptions-item label="载体展示照片上传" span="2">
                    <xlImages v-model="form.carrierPhotos" :max="0"></xlImages>
                </a-descriptions-item>
                <a-descriptions-item label="载体概况" span="2">
                    <div v-html="form.carrierDescribe || '--'">

                    </div>
                </a-descriptions-item>
                <a-descriptions-item label="特色服务" span="2">
                    <div v-html="form.carrierServices|| '--'">

                    </div>
                </a-descriptions-item>
                <a-descriptions-item label="周边配套" span="2">
                    <div v-html="form.carrierSurrounding|| '--'">

                    </div>
                </a-descriptions-item>
            </a-descriptions>
        </a-form-model>
    </a-modal>
</template>

<script>
    import xlDate from '../../../../../components/formUntil/xlDate'
    import xlImage from '../../../../../components/formUntil/xlImage'
    import xluploadFile from '../../../../../components/formUntil/xluploadFile'
    import xlImages from '../../../../../components/formUntil/xlImages'
    import {carrierBasicInfoUpdate} from "../../../../../assets/api";
    export default {
        name: "xlForm",
        data() {
            return {
                tableTitle: '编辑',
                visible: false,
                confirmLoading: false,
                form: {},
                rules:{}
            }
        },
        components:{
            xlDate,
            xlImage,
            xluploadFile,
            xlImages
        },
        methods: {
            // TODO
            getType(data){
                if(data == 1){
                    return '孵化器'
                }
                if(data == 2){
                    return '众创空间'
                }
                if(data == 3){
                    return '新型研发机构'
                }
                if(data == 4){
                    return '硅巷'
                }
            },
            handleOk() {
                this.visible = false
            },
            handleCancel() {
                this.visible = false
            },
            formatForm(form) {
                delete form.createDateTime
                delete form.modifyDateTime
                delete form.modifyBy
                delete form.createBy
                //整理字段数据 ／ 赋值 清空等
                this.form = Object.assign({}, form)
            }
        }
    }
</script>

<style scoped lang="less">
    /deep/ .ant-form-item {
        margin: 0;
    }

    /deep/.ant-input-number{
        width: 100%;
    }
    .xl-dateRange{
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .ant-checkbox-group{
        display: flex;
        flex-wrap: wrap;
        .xl-checkbox{
            display: flex;
            align-items: center;
            /deep/ span:nth-child(2):not(.ant-checkbox-inner){
                display: flex;
                justify-content: space-between;
                white-space: pre;
            }
        }
    }
</style>
